Skip to content

chore: update bumpy to 1.18.0 + adopt ci comment fork-comment split#840

Merged
theoephraim merged 3 commits into
mainfrom
bumpy-1.18-comment-split
Jun 26, 2026
Merged

chore: update bumpy to 1.18.0 + adopt ci comment fork-comment split#840
theoephraim merged 3 commits into
mainfrom
bumpy-1.18-comment-split

Conversation

@theoephraim

@theoephraim theoephraim commented Jun 26, 2026

Copy link
Copy Markdown
Member

Updates @varlock/bumpy to ^1.18.0 and migrates the PR release-plan comment to 1.18's official fork-safe split, replacing the hand-rolled pull_request_target workflow from #837.

What changed

  • bumpy-check.yaml — rewritten from pull_request_target to plain pull_request with a read-only token. It computes the release plan, gates on missing bump files, and writes the rendered comment to the bumpy-comment artifact (ci check --emit-comment). Running PR code is safe here because the token can't post or write. Job renamed checkbumpy-check so its status context (Bumpy check / bumpy-check) is unambiguous in branch protection.
  • bumpy-comment.yaml (new) — workflow_run poster that runs in a trusted context (never checks out PR code), downloads the untrusted artifact to runner.temp (outside the checkout, so it can't overwrite trusted files — CodeQL actions/artifact-poisoning), and posts it (ci comment --body-file). The target PR is resolved from the trusted workflow_run event, never from the artifact.
  • package.json — bumpy ^1.17.0^1.18.0.

release.yaml already uses the recommended split planversion-pr/publish pattern, so it's unchanged.

Rollout notes

  • workflow_run triggers always run the definition from the default branch, so bumpy-comment.yaml only activates after this merges to main — the release-plan comment will start appearing on PRs opened after merge.
  • If you require this check in branch protection, require Bumpy check / bumpy-check.

Replace the hand-rolled pull_request_target release-plan comment with bumpy
1.18's two-workflow split:
- bumpy-check.yaml now runs on plain pull_request with a read-only token,
  gates on missing bump files, and emits the rendered comment as an artifact
  (ci check --emit-comment).
- bumpy-comment.yaml is a new workflow_run poster that downloads that artifact
  and posts it (ci comment --body-file), resolving the target PR from the
  trusted event rather than the artifact.

release.yaml already matches the recommended split plan/version-pr/publish
pattern, so it is unchanged.
Comment thread .github/workflows/bumpy-comment.yaml Fixed
theoephraim added a commit to dmno-dev/bumpy that referenced this pull request Jun 26, 2026
…ct-poisoning) (#146)

## Why

varlock adopted the 1.18 `workflow_run` fork-comment split
([varlock#840](dmno-dev/varlock#840)) and CodeQL
flagged the poster with a **critical** `actions/artifact-poisoning`
alert. The recommended `bumpy-comment.yaml` (and our dogfood copy)
downloads the untrusted artifact into `./bumpy-comment` — i.e. *inside*
`GITHUB_WORKSPACE`, alongside the trusted checkout. CodeQL's
recommendation is to "extract artifacts to a temporary folder so they
cannot override existing files."

bumpy's own repo has no CodeQL workflow, so neither the dogfood poster
nor the docs template was ever analyzed — varlock (which runs CodeQL
Actions analysis) was the first to surface it.

## What

- **`docs/github-actions.md`** — the recommended poster now downloads to
`${{ runner.temp }}/bumpy-comment` (outside the checkout) and reads
`--body-file "$RUNNER_TEMP/bumpy-comment/comment.md"`.
- **`.github/workflows/bumpy-comment.yaml`** (dogfood) — same change;
dropped the now-moot "download after checkout or it gets wiped" note
since temp is outside the workspace.
- **Safety-rule callout** — documents *why* (untrusted artifact can't
overwrite trusted files) and adds a short note that CodeQL's
`actions/artifact-poisoning` query may flag the step: the temp-dir
download addresses its core recommendation, and if a strict variant
still flags it, it's a dismissable false positive (body used only as
comment text; PR resolved from the trusted `workflow_run` event, never
the artifact).

The upload side (unprivileged render step) intentionally keeps
`./bumpy-comment` — only the privileged download moves to temp.

## Notes

Docs + a dogfood workflow comment/path change. No behavior change to the
comment that gets posted. The `runner.temp` path is outside
`GITHUB_WORKSPACE` on hosted runners, so the trusted checkout (read for
the pinned bumpy version) is untouched.
@theoephraim theoephraim merged commit 060adb4 into main Jun 26, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants